# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

_name=frameworkintegration
pkgname=${_name}5
pkgver=5.112.0
pkgrel=2
pkgdesc='Framework providing components to allow applications to integrate with a KDE Workspace'
arch=(loong64 x86_64)
url='https://community.kde.org/Frameworks'
license=(LGPL)
depends=(knewstuff5)
makedepends=(extra-cmake-modules appstream-qt5 packagekit-qt5)
optdepends=('appstream-qt5: dependency resolving via AppStream' 'packagekit-qt5: dependency resolving via AppStream')
conflicts=("$_name<5.111")
replaces=("$_name<5.111")
groups=(kf5)
source=(https://download.kde.org/stable/frameworks/${pkgver%.*}/$_name-$pkgver.tar.xz{,.sig}
        appstream-1.0.patch)
sha256sums=('c63eb1f13bc62868ecd8cde92abd119953c309f729d9776115485294d9263ece'
            'SKIP'
            '5555481143c453414da9a304af0b4f9bdcca0488c09a7b96c95b6f57bfc36945')
validpgpkeys=(53E6B47B45CEA3E0D5B7457758D0EE648A48B3BB) # David Faure <faure@kde.org>

prepare() {
  patch -d $_name-$pkgver -p1 < appstream-1.0.patch # Support appstream 1.0
}

build() {
  cmake -B build -S $_name-$pkgver \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DBUILD_TESTING=OFF
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
